import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooFeedbackController } from '../../../controllers';
const uctoofeedbackRouter = new Router();
const feedbackController = new uctooFeedbackController();

uctoofeedbackRouter.post('/add', requireUser, feedbackController.add);
uctoofeedbackRouter.post('/edit', requireUser, rowLevelPermission('uctoo/feedback'), feedbackController.edit);
uctoofeedbackRouter.post('/del', requireUser, rowLevelPermission('uctoo/feedback'), feedbackController.delete);

//For getting feedback with permission control
uctoofeedbackRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/feedback'), feedbackController.getSingle);
uctoofeedbackRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/feedback'), feedbackController.getMany);
uctoofeedbackRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/feedback'), feedbackController.getMany);

//#endregion AutoCreateCode
export default uctoofeedbackRouter;
